Skip to content

[PT FE] Refactor PixelShuffle operations#33743

Open
mvafin wants to merge 3 commits intoopenvinotoolkit:masterfrom
mvafin:mvafin/pt_fe/pshuffle
Open

[PT FE] Refactor PixelShuffle operations#33743
mvafin wants to merge 3 commits intoopenvinotoolkit:masterfrom
mvafin:mvafin/pt_fe/pshuffle

Conversation

@mvafin
Copy link
Contributor

@mvafin mvafin commented Jan 21, 2026

Details:

  • Simplify and refactor PixelShuffle operations
  • Simplify neg operation

Tickets:

  • ticket-id

@mvafin mvafin requested a review from Copilot January 21, 2026 17:46
@mvafin mvafin requested a review from a team as a code owner January 21, 2026 17:46
@github-actions github-actions bot added the category: PyTorch FE OpenVINO PyTorch Frontend label Jan 21, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the PixelShuffle operations and simplifies the negation operation in the PyTorch frontend by leveraging existing OpenVINO operations instead of custom implementations.

Changes:

  • Replaced custom translate_neg implementation with a direct mapping to opset10::Negative
  • Refactored translate_pixel_shuffle and translate_pixel_unshuffle to use DepthToSpace and SpaceToDepth operations
  • Simplified translate_channel_shuffle to use the ShuffleChannels operation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/frontends/pytorch/src/op_table.cpp Updated operation mappings to use translate_1to1_match_1_inputs<opset10::Negative> instead of translate_neg
src/frontends/pytorch/src/op/pixel_shuffle.cpp Refactored pixel shuffle operations to use built-in OpenVINO operations and introduced helper functions for common shape manipulations
src/frontends/pytorch/src/op/neg.cpp Removed entire file as the custom implementation is no longer needed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Maxim Vafin <maxim.vafin@intel.com>
Signed-off-by: Maxim Vafin <maxim.vafin@intel.com>
@mvafin mvafin added this to the 2026.1 milestone Jan 21, 2026
@mvafin mvafin requested a review from bumbosiepsak January 23, 2026 10:05
Copy link
Contributor

@bumbosiepsak bumbosiepsak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite smart! (I like usage of native operations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: PyTorch FE OpenVINO PyTorch Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants